package com.googlecode.gwtbb.client.shared.util;

import com.googlecode.gwtbb.client.shared.entity.properties.GetId;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * @author Abraham Grief
 * @version $Id$
 * @since Jul 24, 2008
 */
public class IdUtils {
	public static List<Long> getIds(Collection<? extends GetId> identifiables) {
		if (identifiables == null)
			return null;
		List<Long> retVal = new ArrayList<Long>(identifiables.size());
		for (GetId identifiable : identifiables)
			retVal.add(identifiable.getId());
		return retVal;
	}

	private IdUtils() {
	}
}
